<?php
/**
 * @author tungck
 * @filesource account_model.php
 * file model for process staff manager
*/
?>

<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class event_model extends CI_Model{
    
    function __construct(){
        parent::__construct();
        $this->load->helper('url');
        $this->load->database();
        
    }
    
    // l?y danh sách nhân viên
    function getList($data){
        $recordCount = $this->db->count_all_results('sukien');
        $query = $this->db->query("SELECT * FROM sukien ORDER BY Ngay DESC LIMIT " . $data['startIndex'] . "," . $data['pageSize'] . ";");
        if($query){
            $result['query'] = $query->result();
            $result['recordCount'] = $recordCount;
            return $result;
        }else{
            return false;
        }
        
    }
    
    
    function getById($id){
        $query = $this->db->query("SELECT * FROM sukien WHERE MaSuKien = ".$id.";");
        if($query){
            $result = $query->result();
            return $result;
        }else{
            return false;
        }
        
    }
}

?>